package com.jz.kufangkuqu.kuqu.mapper;

import com.jz.kufangkuqu.kuqu.bean.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface KuQuMapper {


    List<KuQu> queryPage(KuQuSelect kuQuSelectVo);

    int count(KuQuSelect kuQuSelectVo);

    void add(KuQu legalPlantVo1);

    int updatePlant(KuQu legalPlant1);

    void updateStatus(KuQu legalPlant1);

    void addShuXing( KuQu legalPlantVo1);

    @Select("SELECT kq.id,kq.code,kq.`name`,kq.`status`,kq.remark,kq.warehouseManagement,kq.wmsIntegrate,kq.vipStorageSection," +
            "kf.code wareHouseCode,kf.name wareHouseName,kf.remark  wareHouseRemark  FROM kuqu kq " +
            "LEFT JOIN kufang kf ON kq.wareHouseCode=kf.code " +
            "where kq.id=#{id}")
    KuQuFangHui updateHuiXian(KuQuUpdateHuiXian kuQuUpdate);

    @Select(" SELECT sx.shuxingcode FROM kuqu k LEFT JOIN kuqushuxing sx on k.`code`=sx.kuqucode WHERE k.`code`=#{code} ")
    List<ShuXingXiaLa> queryShuxinng(String code);

}
